import React, { useState, useTransition, useDeferredValue } from 'react'
import Card from './Card'
export default function App() {
  const [keyWord, setKeyWord] = useState('')

  const delayKeyWord = useDeferredValue(keyWord)

  return (
    <div>
      请输入关键字:
      <input
        type="text"
        value={keyWord}
        onChange={(e) => {
          setKeyWord(e.target.value.trim())
        }}
      />
      <hr />
      <Card searchQuery={delayKeyWord}></Card>
    </div>
  )
}
